<!DOCTYPE html>
<!--suppress ALL-->
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${title}"></title>
    <link rel="stylesheet" th:href="@{/static/css/my.css}">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <link rel="short icon" th:href="@{/static/images/favicon.ico}">
    <!-- all plugins here -->
    <script th:src="@{/static/js/vendor.js}"></script>
    <script th:src="@{/static/js/jquery.magnific-popup.min.js}"></script>
    <!-- main js  -->
    <script th:src="@{/static/js/main.js}"></script>
    <!-- Stylesheet -->
    <link rel="stylesheet" th:href="@{/static/css/vendor.css}">
    <link rel="stylesheet" th:href="@{/static/css/magnific-popup.css}">
    <link rel="stylesheet" th:href="@{/static/css/style3.css}">
    <link rel="stylesheet" th:href="@{/static/css/responsive.css}">
    <link rel="stylesheet" href="/static/css/highlight.line-numbers.css">
    <link rel="stylesheet" href="/static/css/highlightjs-copy-button.css">
    <!--代码高亮样式-->
    <link rel="stylesheet"
          th:href="@{'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/'+${codeStyle==null?'androidstudio':codeStyle}+'.min.css'}">
    <!--代码高亮js文件-->
    <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
    <!--行号js文件-->
    <script src="/static/js/highlight.line-numbers.js"></script>
    <!--代码复制-->
    <script src="/static/js/highlightjs-copy-button.js"></script>
    <script src="/static/js/highlightjs-copy-button.min.js"></script>
    <!--初始化-->
    <script>
        hljs.initHighlightingOnLoad();//代码高亮
        hljsln.initLineNumbersOnLoad();//行号
        hljs.initCopyButtonOnLoad();//代码复制
    </script>
    <style type="text/css">

    </style>
    <script th:inline="javascript">
        function submitComment() {
            var content = $("#commentContent").val();
            var blogId = $("#commentBlogId").val();
            if (content == null || content == '') {
                alert("请输入评论内容!!");
                return false;
            }
            $.post("/comment/add", {content: content, blogId: blogId},
                function (result) {
                    if (result.success) {
                        alert("评论成功,审核通过后方可在下方显示!!");
                        $("#commentContent").val("");
                    } else {
                        alert(result.errorInfo);
                    }
                }
            );
        }

        //用户点赞博客
        function like() {
            var blogId = $("#commentBlogId").val();
            $.post("/like/add", {blogId: blogId},
                function (result) {
                    if (result.success) {
                        alert("点赞成功!!");
                        $("#like1").attr("hidden", "true");
                        $("#like2").removeAttr("hidden");
                    } else {
                        alert("点赞失败!!");
                    }
                }
            );
        }

        //点赞博客按钮悬停提示
        $(function () {
            var x = 10;
            var y = 20;
            var newtitle = '';
            $('i.mytooltip').mouseover(function (e) {
                newtitle = this.title;
                this.title = '';
                $('body').append('<div id="mytitle" >' + newtitle + '</div>');
                $('#mytitle').css({
                    'left': (e.pageX + x + 'px'),
                    'top': (e.pageY + y - 80 + 'px')
                }).show();
            }).mouseout(function () {
                this.title = newtitle;
                $('#mytitle').remove();
            }).mousemove(function (e) {
                $('#mytitle').css({
                    'left': (e.pageX + x + 10 + 'px'),
                    'top': (e.pageY + y - 60 + 'px')
                }).show();
            })
        });

        $(document).on('click', '.back-to-top', function () {
            $("html,body").animate({
                scrollTop: 0
            }, 2000);
        });


        $(document).ready(function () {
            //全部图片
            $("img").addClass("img-responsive");
            $("img").addClass("img-thumbnail");
            //首页图片
            $(".indexFirstImage").removeClass("pimg");
            //备案图片
            $("#img2").removeClass("img-responsive");
            $("#img2").removeClass("img-thumbnail");
            //完字图片
            $("#img3").removeClass("img-responsive");
            $("#img3").removeClass("img-thumbnail");
            $("table").addClass("table table-striped table-hover");
            $('pre code').each(function (i, block) {
                hljs.highlightBlock(block);
            });
            $("pre").css("font-size", "16px");
            $("img").attr("alt", "请刷新本页面以查看图片，如果图片已失效请到对应博客的评论区下给我留言┭┮﹏┭┮");
        });
    </script>
</head>
<body>
<!-- back to top area start -->
<div class="back-to-top">
    <span class="back-top"><i class="fa fa-angle-double-up"></i></span>
</div>
<!-- back to top area end -->
<div>
    <div th:include="common/head3::#h"></div>
    <div th:include="${mainPage}::${mainPageKey}"></div>
    <div th:include="common/foot3::#f"></div>
</div>
</body>
</html>